package cn.gcyl.module.biz.dal.mysql.useractionlog;

import java.util.*;

import cn.gcyl.framework.common.pojo.PageResult;
import cn.gcyl.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.gcyl.framework.mybatis.core.mapper.BaseMapperX;
import cn.gcyl.module.biz.dal.dataobject.useractionlog.UserActionLogDO;
import org.apache.ibatis.annotations.Mapper;
import cn.gcyl.module.biz.controller.admin.useractionlog.vo.*;

/**
 * 用户操作日志 Mapper
 *
 * @author 芋道源码
 */
@Mapper
public interface UserActionLogMapper extends BaseMapperX<UserActionLogDO> {

    default PageResult<UserActionLogDO> selectPage(UserActionLogPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<UserActionLogDO>()
                .eqIfPresent(UserActionLogDO::getUserId, reqVO.getUserId())
                .eqIfPresent(UserActionLogDO::getAction, reqVO.getAction())
                .betweenIfPresent(UserActionLogDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(UserActionLogDO::getId));
    }

}